furny.swing.admin
Class BrowserPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by furny.swing.admin.BrowserPanel
All Implemented Interfaces:
FurnitureUpdateListener, IFurnitureBrowser, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class BrowserPanel
extends javax.swing.JPanel
implements FurnitureUpdateListener, IFurnitureBrowser

This is an extended JPanel that contains a table displaying furnitures.

Since:
12.08.2012
Author:
Stephan Dreyer
See Also:
Serialized Form

Nested Class Summary
private  class BrowserPanel.ActionAddTagsToAll
          Action to add tags to all visible furnitures.
private  class BrowserPanel.ActionDeleteAll
          Action to delete all visible furnitures.
private  class BrowserPanel.ActionFind
          Action to trigger a search.
private  class BrowserPanel.ActionRefresh
          Action to refresh the furniture ids.
private  class BrowserPanel.ActionResetSearch
          Action to reset the search text field.
private  class BrowserPanel.FurnitureCellRenderer
          Table cell renderer for furnitures.
private  class BrowserPanel.FurnitureTableModel
          Table model for furnitures.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JTextField findField
           
private  java.util.List<java.lang.Long> furnIds
           
private  java.util.Map<java.lang.Long,Furniture> map
           
private  javax.swing.JComboBox searchTypeComboBox
           
private  javax.swing.JTable table
           
private  BrowserPanel.FurnitureTableModel tableModel
           
private  IFurnitureViewer viewer
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BrowserPanel(IFurnitureViewer viewer)
          Instantiates a new browser panel.
 
Method Summary
private  void find(boolean equals)
          Triggers a search.
private  void find(SearchType type, java.lang.String text, boolean equals)
          Find furnitures by a text and search type.
 void furnitureDeleted(java.lang.Long id)
          This method will be notified if a furniture is updated.
 void furnitureIdsUpdated(java.util.List<java.lang.Long> ids)
          This method will be notified if a list of furnitures are updated.
 void furnitureUpdated(java.lang.Long id, Furniture furniture)
          This method will be notified if a furniture is updated.
private  void resetSearch()
          Resets the search text field and results.
 void searchByTag(java.lang.String text)
          Triggers a search.
private  void updateIds()
          Gets the current furniture ids from the FurnDBManager.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

furnIds

private final java.util.List<java.lang.Long> furnIds

map

private final java.util.Map<java.lang.Long,Furniture> map

table

private final javax.swing.JTable table

tableModel

private final BrowserPanel.FurnitureTableModel tableModel

findField

private final javax.swing.JTextField findField

searchTypeComboBox

private final javax.swing.JComboBox searchTypeComboBox

viewer

private final IFurnitureViewer viewer
Constructor Detail

BrowserPanel

public BrowserPanel(IFurnitureViewer viewer)
Instantiates a new browser panel.

Parameters:
viewer - the viewer
Since:
12.08.2012
Method Detail

updateIds

private void updateIds()
Gets the current furniture ids from the FurnDBManager.

Since:
12.08.2012

searchByTag

public void searchByTag(java.lang.String text)
Description copied from interface: IFurnitureBrowser
Triggers a search.

Specified by:
searchByTag in interface IFurnitureBrowser
Parameters:
text - Text to search.

find

private void find(SearchType type,
                  java.lang.String text,
                  boolean equals)
Find furnitures by a text and search type.

Parameters:
type - the type
text - the text
equals - if true, the search text must exactly match.
Since:
12.08.2012
See Also:
FurnDBManager.updateIdsByTagName(SearchType, String, boolean)

find

private void find(boolean equals)
Triggers a search.

Parameters:
equals - The text must equal if true
Since:
12.08.2012

resetSearch

private void resetSearch()
Resets the search text field and results.

Since:
12.08.2012

furnitureIdsUpdated

public void furnitureIdsUpdated(java.util.List<java.lang.Long> ids)
Description copied from interface: FurnitureUpdateListener
This method will be notified if a list of furnitures are updated.

Specified by:
furnitureIdsUpdated in interface FurnitureUpdateListener
Parameters:
ids - The list of furniture ids.

furnitureUpdated

public void furnitureUpdated(java.lang.Long id,
                             Furniture furniture)
Description copied from interface: FurnitureUpdateListener
This method will be notified if a furniture is updated.

Specified by:
furnitureUpdated in interface FurnitureUpdateListener
Parameters:
id - The id of the furniture.
furniture - The furniture

furnitureDeleted

public void furnitureDeleted(java.lang.Long id)
Description copied from interface: FurnitureUpdateListener
This method will be notified if a furniture is updated.

Specified by:
furnitureDeleted in interface FurnitureUpdateListener
Parameters:
id - The id of the furniture.